import React from 'react';
import { Pagination as AntdPagination } from 'antd';
import type { PaginationProps } from 'antd';

interface CustomPaginationProps {
  current: number;
  pageSize: number;
  total: number;
  onChange: (page: number, pageSize?: number) => void;
  paginationProps?: Omit<PaginationProps, 'current' | 'pageSize' | 'total' | 'onChange'>;
}

const Pagination: React.FC<CustomPaginationProps> = ({
  current,
  pageSize,
  total,
  onChange,
  paginationProps = {
    showTotal: (t) => `总 ${t} 条`,
    showSizeChanger: false,
    pageSizeOptions: ['10'],
  },
}) => {
  return (
    <div className="pagination">
      <AntdPagination
        current={current}
        pageSize={pageSize}
        total={total}
        onChange={onChange}
        {...paginationProps}
      />
    </div>
  );
};

export default Pagination;